<template>
  <el-form ref="form" label-position="right" class="j-attribute-set" size="mini" label-width="100px">
    <el-form-item label="表头标题">
      <el-input v-model="data.attribute.label" placeholder="请设置表头标题"></el-input>
    </el-form-item>
<!--     <el-form-item label="字段">
      <el-input v-model="data.attribute.field" placeholder="请设置内容字段"></el-input>
    </el-form-item> -->
    <el-form-item label="列宽">
      <el-input v-model="data.attribute.width" placeholder="请设置表格列宽"></el-input>
    </el-form-item>
<!--     <el-form-item label="列宽拖动">
      <el-switch v-model="data.resizable" active-color="#409eff" inactive-color="#efefef"></el-switch>
    </el-form-item> -->
    <el-form-item label="表头对齐方式">
      <el-select v-model="data.attribute['header-align']" placeholder="请设置表头对齐方式">
        <el-option label="左对齐" value="left"></el-option>
        <el-option label="居中对齐" value="center"></el-option>
        <el-option label="右对齐" value="right"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="内容对齐方式">
      <el-select v-model="data.attribute.align" placeholder="请设置内容对齐方式">
        <el-option label="左对齐" value="left"></el-option>
        <el-option label="居中对齐" value="center"></el-option>
        <el-option label="右对齐" value="right"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="列固定">
      <el-select v-model="data.attribute.fixed" placeholder="请设置列固定">
        <el-option label="不固定" :value="false"></el-option>
        <el-option label="左固定" value="left"></el-option>
        <el-option label="右固定" value="right"></el-option>
      </el-select>
    </el-form-item>
  </el-form>
</template>
<script type="text/javascript">
export default {
  props: {
    value: [Array, Object, Number, String]
  },
  computed: {
    data: {
      get: function() {
        return this.value;
      },
      set: function(value) {
        this.$emit('input', value);
      }
    }
  }

}

</script>
<style type="text/css" lang="scss">
.j-attribute-set {
  padding: 10px;
}

.el-form-item--mini.el-form-item,
.el-form-item--small.el-form-item {
  margin-bottom: 10px;
}

.el-form--label-top .el-form-item__label {
  float: none;
  display: inline-block;
  text-align: left;
  padding: 0;
}

</style>
